home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 580 < prev    next >
Internet Message Format  |  1996-08-06  |  1KB

  1. Path: sundog.tiac.net!stanr
  2. From: stanr@tiac.net (Stan Ryckman)
  3. Newsgroups: gnu.misc.discuss,comp.std.c
  4. Subject: Re: Coding Standards are ignorant
  5. Date: 17 Mar 1996 01:32:48 GMT
  6. Organization: Amber & Sneakers Fan Club
  7. Message-ID: <4ifq40$i87@sundog.tiac.net>
  8. References: <4gum82$14v4@info4.rus.uni-stuttgart.de> <MIB.96Mar15170902@gnu.ai.mit.edu> <wyraut5fqq.fsf@dns.bluesky.net> <MIB.96Mar16174948@gnu.ai.mit.edu>
  9. NNTP-Posting-Host: sunspot.tiac.net
  10.  
  11. (Added comp.std.c; those folks may skip to my question at the end)
  12.  
  13. In article <MIB.96Mar16174948@gnu.ai.mit.edu>,
  14. Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> wrote:
  15.  
  16. [snip]
  17.  
  18. [re Posix.2]
  19. >You can't use printf to print any manifest integer type of unknown
  20. >size, except for size_t.  (And that one only because ANSI went and
  21. >added a special format code for size_t.)
  22.  
  23. Can't you safely do this with casting to the (possibly unsigned) long
  24. type?  e.g.,
  25.     pid_t whatever;
  26.     ...
  27.     printf( "%lu\n", (unsigned long) whatever);
  28. A pain, but hardly a "can't".
  29.  
  30. Oh, and what's that special ANSI format code for size_t?  I can't find
  31. it in 4.9.6.1; was it added after printing or am I just blind?
  32.  
  33. Cheers,
  34. Stan.
  35. --
  36. Stan Ryckman  (stanr@tiac.net)
  37.   (Apologies for non-responses or late responses to some posts;
  38.   .newsrc was trashed and I'm trying to get it back to where it was.)
  39.